﻿@model Student
@{
    ViewData["Title"] = "学生详细信息";
    var ishasImgPath = Model.ImgPath == null;//空位true
    var imgPath = "/imges/" + Model.ImgPath;
}

<h1 class="text-center">@Model.Name 的详细信息</h1>
<div class="row justify-content-center m-3">
    <div class="col-sm-10">
        <div class="card">
            <div style="width:400px;margin:0 auto;">
                @if (ishasImgPath)
                {
                    <img src="~/imges/Uesr.jpg" style="width:400px;height:402px;display:block" />
                }
                else
                {
                    <img src="@imgPath" style="width:400px;height:402px;display:block" />
                }
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">学号</span>
                <span style="font-size:25px;display:block;" class="text-center">@Model.SNo</span>
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">姓名</span>
                <span style="font-size:25px;display:block;" class="text-center">@Model.Name</span>
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">邮箱</span>
                <span style="font-size:25px;display:block;" class="text-center">@Model.Email</span>
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">专业</span>
                <span style="font-size:25px;display:block;" class="text-center">@ViewData["MajorName"]</span>
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">性别</span>
                <span style="font-size:25px;display:block;" class="text-center">@Model.Gender</span>
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">出生日期</span>
                <span style="font-size:25px;display:block;" class="text-center">@Model.Birthday</span>
            </div>
            <div class="container m-2 text-primary text-md-left col-11">
                <span class="text-warning" style="font-size:20px">电话号码</span>
                <span style="font-size:25px;display:block;" class="text-center">@Model.TelPhone</span>
            </div>
            <div class="card-footer text-center">
                <a class="btn btn-primary mt-3" asp-controller="home" asp-action="index">返回</a>
                <a class="btn btn-primary mt-3" asp-action="UpdateStudent" asp-controller="home" asp-route-Id="@Model.Id">修改</a>
                <br />
                <form asp-action="DeleteStudent" asp-controller="home" asp-route-Id="@Model.Id" method="post">
                    <button class="btn btn-danger mt-3" type="submit" onclick="return confirm('确认要删除吗?')">
                        删除
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>

